#include <QtGui>
#include "link.h"
#include "node.h"
#include "port.h"

#ifndef DIAGRAMEWINDOW_H
#define DIAGRAMEWINDOW_H

class DiagramWindow : public QMainWindow
{
  Q_OBJECT;

public:
  DiagramWindow();
  ~DiagramWindow();

private slots:
  void addNode();
  void addPort();
  void addLink();
  void del();
  void cut();
  void copy();
  void paste();
  void bringToFront();
  void sendToBack();
  void properties();
  void updateActions();

private:
  typedef QPair<Node*, Node*> NodePair;

  //void createActions();
  //void createMenus();
  //void createToolBars();
  void setZValue(int z);
  void setupNode(Node *node);
  void setupPort(Port *port);
  Node *selectedNode() const;
  Link *selectedLink() const;
  NodePair selectedNodePair() const;

  QMenu *fileMenu;
  QMenu *editMenu;
  QToolBar *editToolBar;
  QAction *exitAction;
  QAction *propertiesAction;

  QGraphicsScene *scene;
  QGraphicsView *view;

  int minZ;
  int maxZ;
  int seqNumber;
};
#endif

